package com.ctjsoft.fileupload.controller;

import com.ctjsoft.fileupload.entity.ReturnMessage;
import com.ctjsoft.fileupload.entity.TBucketServer;
import com.ctjsoft.fileupload.entity.TFile;
import com.ctjsoft.fileupload.entity.TMinioServer;
import com.ctjsoft.fileupload.server.TBucketServerService;
import com.ctjsoft.fileupload.server.TFileService;
import com.ctjsoft.fileupload.server.TMinioServerService;
import com.ctjsoft.fileupload.utils.MinioClientUtils;
import io.minio.BucketExistsArgs;
import io.minio.ObjectWriteResponse;
import io.minio.errors.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.Date;
import java.util.HashMap;

@Api(value = "Minio服务端控制器", tags = "Minio服务端控制器")
@RestController("minio")
@Log4j2
public class TMinioServerController {

    @Autowired
    TMinioServerService tMinioServerService;

    @GetMapping("getMinioServerList")
    @ApiOperation("获取Minio服务列表")
    ReturnMessage getMinioServerList() {
        ReturnMessage returnMessage = new ReturnMessage();
        returnMessage.setData(tMinioServerService.getMinioServerList());
        return returnMessage;
    }

    int addMinioServer(TMinioServer tMinioServer) {
        return 0;
    }

    int updateMinioServer(TMinioServer tMinioServer) {
        return 0;
    }

    int deleteMinioServer(String id) {
        return 0;
    }

    TMinioServer getMinioServerById(String id) {
        return null;
    }


}
